Add a getter for GdkAppLaunchContext::display
authorMatthias Clasen <mclasen@redhat.com>
Mon, 24 Feb 2020 12:39:20 +0000 (07:39 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 24 Feb 2020 13:32:34 +0000 (08:32 -0500)
docs/reference/gdk/gdk4-sections.txt
gdk/gdkapplaunchcontext.c
gdk/gdkapplaunchcontext.h

index 7a065041db12d1198be0e75e429d1ae7f06e3e71..e2943f152da63f35015a6b66da5ec7e06f7d4694 100644 (file)
@@ -994,6 +994,7 @@ gdk_wayland_surface_get_type
 <TITLE>Application launching</TITLE>
 <FILE>gdkapplaunchcontext</FILE>
 GdkAppLaunchContext
+gdk_app_launch_context_get_display
 gdk_app_launch_context_set_desktop
 gdk_app_launch_context_set_timestamp
 gdk_app_launch_context_set_icon
index 97c72aad4f1e2218aad4b5752dc9632f6838dc72..7a7e3956aea0a6edf117e2c64cd1a04bb1927a2d 100644 (file)
@@ -60,9 +60,9 @@
  */
 
 static void    gdk_app_launch_context_finalize    (GObject           *object);
-static gchar * gdk_app_launch_context_get_display (GAppLaunchContext *context,
-                                                   GAppInfo          *info,
-                                                   GList             *files);
+static gchar * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
+                                                        GAppInfo          *info,
+                                                        GList             *files);
 static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
                                                              GAppInfo          *info,
                                                              GList             *files);
@@ -125,7 +125,7 @@ gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
 
   gobject_class->finalize = gdk_app_launch_context_finalize;
 
-  context_class->get_display = gdk_app_launch_context_get_display;
+  context_class->get_display = gdk_app_launch_context_get_display_name;
   context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id;
   context_class->launch_failed = gdk_app_launch_context_launch_failed;
 
@@ -158,9 +158,9 @@ gdk_app_launch_context_finalize (GObject *object)
 }
 
 static gchar *
-gdk_app_launch_context_get_display (GAppLaunchContext *context,
-                                    GAppInfo          *info,
-                                    GList             *files)
+gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
+                                         GAppInfo          *info,
+                                         GList             *files)
 {
   GdkAppLaunchContext *ctx = GDK_APP_LAUNCH_CONTEXT (context);
   GdkDisplay *display;
@@ -173,6 +173,22 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context,
   return g_strdup (gdk_display_get_name (display));
 }
 
+/**
+ * gdk_app_launch_context_get_display:
+ * @context: a #GdkAppLaunchContext
+ *
+ * Gets the #GdkDispolat that @context is for.
+ *
+ * Returns: the display of @context
+ */
+GdkDisplay *
+gdk_app_launch_context_get_display (GdkAppLaunchContext *context)
+{
+  g_return_val_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context), NULL);
+
+  return context->display;
+}
+
 /**
  * gdk_app_launch_context_set_desktop:
  * @context: a #GdkAppLaunchContext
index 6109480ed075d7cf370ece69db904fa9a3329ce2..575a86750133a2e2b213ab5d1b6e3978f8f4dd62 100644 (file)
@@ -38,6 +38,9 @@ G_BEGIN_DECLS
 GDK_AVAILABLE_IN_ALL
 GType                gdk_app_launch_context_get_type      (void);
 
+GDK_AVAILABLE_IN_ALL
+GdkDisplay *         gdk_app_launch_context_get_display   (GdkAppLaunchContext *context);
+
 GDK_AVAILABLE_IN_ALL
 void                 gdk_app_launch_context_set_desktop   (GdkAppLaunchContext *context,
                                                            gint                 desktop);
@@ -51,6 +54,7 @@ GDK_AVAILABLE_IN_ALL
 void                 gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
                                                            const char          *icon_name);
 
+
 G_END_DECLS
 
 #endif /* __GDK_APP_LAUNCH_CONTEXT_H__ */